<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:s="http://jboss.org/schema/seam/taglib"
                template="template.xhtml">
    
    <!-- content -->
    <ui:define name="content">
        <div class="section">
            <h1>Change Your Password</h1>
        </div>
        <div class="section">
            <h:form id="setpassword">
                
                <f:facet name="afterInvalidField">
                    <s:message id="Message"/>
                </f:facet>
                <f:facet name="aroundInvalidField">
                    <s:span id="Error" styleClass="errors"/>
                </f:facet>
                
                <fieldset>
                    
                    <div class="entry">
                        <div class="label"><h:outputLabel for="password">New Password:</h:outputLabel></div>
                        <div class="input">
                            <s:decorate id="PasswordDecorate">
                                <h:inputSecret id="password" value="#{user.password}" required="true">
                                </h:inputSecret>
                                <br/>
                            </s:decorate>
                        </div>
                    </div>
                    
                    <div class="entry">
                        <div class="label"><h:outputLabel for="password">Old Password:</h:outputLabel></div>
                        <div class="input">
                            <s:decorate id="VerifyDecorate">
                                <h:inputSecret id="verify" value="#{changePassword.verify}" required="true"/>
                                <br/>
                            </s:decorate>
                        </div>
                    </div>
                    
                    <div class="entry errors">
                        <h:messages id="Messages" globalOnly="true"/>
                    </div>
                    
                    <div class="entry">
                        <div class="label">&#160;</div>
                        <div class="input">
                            <h:commandButton id="change" value="Change" 
                                             action="#{changePassword.changePassword}"/>&#160;
                            <s:button id="cancel" value="Cancel" view="/main.xhtml"/>
                        </div>
                    </div>
                    
                </fieldset>
                
            </h:form>
        </div>
    </ui:define>
    
    <ui:define name="sidebar" />
</ui:composition>
